package org.senseframework.support.open.api.helper;


import java.util.List;

/**
 * Created by lanjian
 */
public class ResponseDTOHelper {


    public interface Call<T> {
        T call(T t);
    }

    public static void addList(List list, Object temp) {
        addList(list, temp, null);
    }

    public static void addList(List list, Object temp, Call call) {
        if (temp != null) {
            if (call != null) {
                list.add(call.call(temp));
            } else {
                list.add(temp);
            }

        }
    }

}
